package com.zhanghao.sdk;

import android.content.Context;
import android.content.Intent;

import com.zhanghao.sdk.callback.IZHSDKCallback;
import com.zhanghao.sdk.model.Order;
import com.zhanghao.sdk.model.Role;

import java.util.HashMap;

public class UnionSDK implements IUnionSDK {

    private static UnionSDK instance;


    public static UnionSDK getInstance() {
        if(instance == null) {
            instance = new UnionSDK();
        }
        return instance;
    }

    @Override
    public void init(Context context, IZHSDKCallback SDKCallback) {
        SDKManager.getInstance().init(context, SDKCallback);
    }

    @Override
    public void login() {
        SDKManager.getInstance().login();

    }

    @Override
    public void pay(Order order) {
        SDKManager.getInstance().pay(order);

    }

    @Override
    public void gameReport(String eventName, Role roleInfo) {
        SDKManager.getInstance().gameReport(eventName, roleInfo);

    }

    @Override
    public void customEvent(String eventName, HashMap args) {
        SDKManager.getInstance().customEvent(eventName, args);
    }

    @Override
    public void logOut() {
        SDKManager.getInstance().login();
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        SDKManager.getInstance().onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public void onResume() {
        SDKManager.getInstance().onResume();
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        SDKManager.getInstance().onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}
